import java.util.Scanner;

/**
 * ClassName : PACKAGE_NAME.YangHui
 * Desc : TODO
 *
 * @author : LINPQ
 * @date : 2020/12/8 10:48
 */
public class YangHui {
    public static void main(String[] args) {

        System.out.println("请输入一个数字：");
        Scanner scanner = new Scanner(System.in);
        int anInt = scanner.nextInt();
        int[][] arrs = new int[anInt][anInt];

        for (int i = 0; i < arrs.length; i++) {
            arrs[i][0] = 1;
            arrs[i][i] = 1;
            for (int j = 0; j < arrs[i].length; j++) {
                if(i>0&&j>0){
                    arrs[i][j] = arrs[i - 1][j] + arrs[i - 1][j - 1];
                }

            }
        }


        for (int i = 0; i < arrs.length; i++) {
            for (int j = 0; j < arrs.length-i ; j++) {
                System.out.print("  ");
            }

            for (int j = 0; j <=i; j++) {
                System.out.print(arrs[i][j] + "\t");
            }
            System.out.println();
        }

    }
}
